<template>
<view class="user-getcoupon">
    <coupon-list v-if="!showNull" :list="couponList" :btn-type="3" @reflash="getCouponListFun"></coupon-list>
    <view v-else class="column-center" style="padding-top: 200rpx">
        <image class="img-null"  :src="`${imgPrefix}/images/xcxweb/coupon_null.png`"></image>
        <text class="muted">暂无优惠券可领～</text>
    </view>
</view>
</template>

<script>
import { getCouponList } from '../../api/activity';
import {getCoupon} from "../../api/user"
import { baseURL } from "@/config/app"

export default {
  data() {
    return {
      couponList: [],
      showNull: false,
	  imgPrefix: baseURL
    };
  },

  components: {
      
  },
  props: {},

  onLoad (options) {
    this.getCouponListFun();
  },

  methods: {
    getCouponListFun() {
      getCouponList().then(res => {
        if (res.code == 1) {
          if (res.data.length <= 0) {
            this.showNull = true;
            return;
          }
            this.couponList = res.data;
        }
      });
    }

  }
};
</script>
<style>
</style>